Integrand size = 31, antiderivative size = 195 \[ \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\frac {(A+i B) \operatorname {AppellF1}\left (1-m,-n,1,2-m,-\frac {b \tan (c+d x)}{a},-i \tan (c+d x)\right ) \cot ^{-1+m}(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}}{2 d (1-m)}+\frac {(A-i B) \operatorname {AppellF1}\left (1-m,-n,1,2-m,-\frac {b \tan (c+d x)}{a},i \tan (c+d x)\right ) \cot ^{-1+m}(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}}{2 d (1-m)} \]
[Out]
Time = 0.50 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {4326, 3684, 3683, 140, 138} \[ \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\frac {(A+i B) \cot ^{m-1}(c+d x) (a+b \tan (c+d x))^n \left (\frac {b \tan (c+d x)}{a}+1\right )^{-n} \operatorname {AppellF1}\left (1-m,-n,1,2-m,-\frac {b \tan (c+d x)}{a},-i \tan (c+d x)\right )}{2 d (1-m)}+\frac {(A-i B) \cot ^{m-1}(c+d x) (a+b \tan (c+d x))^n \left (\frac {b \tan (c+d x)}{a}+1\right )^{-n} \operatorname {AppellF1}\left (1-m,-n,1,2-m,-\frac {b \tan (c+d x)}{a},i \tan (c+d x)\right )}{2 d (1-m)} \]
[In]
[Out]
Rule 138
Rule 140
Rule 3683
Rule 3684
Rule 4326
Rubi steps \begin{align*} \text {integral}& = \left (\cot ^m(c+d x) \tan ^m(c+d x)\right ) \int \tan ^{-m}(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \\ & = \frac {1}{2} \left ((A-i B) \cot ^m(c+d x) \tan ^m(c+d x)\right ) \int (1+i \tan (c+d x)) \tan ^{-m}(c+d x) (a+b \tan (c+d x))^n \, dx+\frac {1}{2} \left ((A+i B) \cot ^m(c+d x) \tan ^m(c+d x)\right ) \int (1-i \tan (c+d x)) \tan ^{-m}(c+d x) (a+b \tan (c+d x))^n \, dx \\ & = \frac {\left ((A-i B) \cot ^m(c+d x) \tan ^m(c+d x)\right ) \text {Subst}\left (\int \frac {x^{-m} (a+b x)^n}{1-i x} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac {\left ((A+i B) \cot ^m(c+d x) \tan ^m(c+d x)\right ) \text {Subst}\left (\int \frac {x^{-m} (a+b x)^n}{1+i x} \, dx,x,\tan (c+d x)\right )}{2 d} \\ & = \frac {\left ((A-i B) \cot ^m(c+d x) \tan ^m(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}\right ) \text {Subst}\left (\int \frac {x^{-m} \left (1+\frac {b x}{a}\right )^n}{1-i x} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac {\left ((A+i B) \cot ^m(c+d x) \tan ^m(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}\right ) \text {Subst}\left (\int \frac {x^{-m} \left (1+\frac {b x}{a}\right )^n}{1+i x} \, dx,x,\tan (c+d x)\right )}{2 d} \\ & = \frac {(A+i B) \operatorname {AppellF1}\left (1-m,-n,1,2-m,-\frac {b \tan (c+d x)}{a},-i \tan (c+d x)\right ) \cot ^{-1+m}(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}}{2 d (1-m)}+\frac {(A-i B) \operatorname {AppellF1}\left (1-m,-n,1,2-m,-\frac {b \tan (c+d x)}{a},i \tan (c+d x)\right ) \cot ^{-1+m}(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}}{2 d (1-m)} \\ \end{align*}
\[ \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \]
[In]
[Out]
\[\int \cot \left (d x +c \right )^{m} \left (a +b \tan \left (d x +c \right )\right )^{n} \left (A +B \tan \left (d x +c \right )\right )d x\]
[In]
[Out]
\[ \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{m} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{m} \,d x } \]
[In]
[Out]
\[ \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{m} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int {\mathrm {cot}\left (c+d\,x\right )}^m\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \]
[In]
[Out]